<?php
/**
 * 测试是否可以进行加解密
 */
require_once("includes/cls_rsa.php");
header("Content-type:text/html;charset=utf8");
$data = 'liyong';
$rsa = new Rsa('includes/rsa_key');
$encrypted = $rsa->pubEncrypt($data);
echo "Message : $data <br>";
echo "PublicKey Encrypt: $encrypted <br>";
$decrypted = $rsa->priDecrypt($encrypted);
echo "PrivateKey Decrypt: $decrypted <br>";

$encrypted = $rsa->priEncrypt($data);
echo $encrypted;
$decrypted = $rsa->pubDecrypt($encrypted);
echo $decrypted;

?>